<template>
  <div class="index">
    <div class="wraper">
      <div class="content">
        <h1>丽江网
          <span>|</span>
        </h1>
        <span>移动应用 active:{{active}} animate:{{animate}}</span>
      </div>

      <div :style="styleObj">
        <div class="content">
          <div class="box">
            <ul class="scollor" :style="animate">
              <li>iphone版本介绍</li>
              <li>android版本介绍</li>
            </ul>
          </div>
        </div>
      </div>
      <div class="tabs">
        <div class="content">
          <button @click="showPartform(0)">iphone</button>
          <button @click="showPartform(1)">android</button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'HelloWorld',
    data() {
      return {
        active: 0,
        currentactive: 0,
        styleObj: {
          height: "400px",
          background:'#ff6600'
        },
        animate: {
          position: "absolute",
          transition: "left .7s",
          left:0
        }
      }
    },
    methods: {
      showPartform(partform) {
        this.active = partform
        const move = 1000; //移动的偏移量
        console.log(partform);
        this.animate.left =  - this.active * move + 'px'
      }
    },
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  .content h1 {
    font-size: 26px;
    font-weight: normal;
    display: inline;
  }

  .tabs {
    height: 100px;
    background: darkslateblue;
  }
</style>